package com.neusoft;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.neusoft.po.User;
import com.neusoft.service.UserService;

public class MySpringTest {
	public static void main(String[] args) {
		//读取Spring配置文件,获取Spring容器
		ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
		//通过Spring容器的getBean方法获得对象
		UserService service = (UserService) context.getBean("userService");
		User user = service.getUser();
		System.out.println(user);
	}
}